package com.epalmpay.service.weixin;



import com.epalmpay.dto.member.SubscribeMemberDTO;
import com.epalmpay.plugin.MyWxMpConfigStorage;
import com.epalmpay.util.Token;

import me.chanjar.weixin.mp.bean.result.WxMpUser;


/**
 * Created by lifayi on 2017/5/16.
 */
public interface IWxBaseService {
	
	
	
	/**
	 * 
	 * @param developid  原始id
	 * @param eventKey   二维码 scene_id值
	 * @param userWxInfo 微信用户信息
	 * @return
	 * @throws Exception
	 */
	public SubscribeMemberDTO savesubscribe(String developid,String eventKey,WxMpUser userWxInfo,String nickname) throws Exception;
	
	
	/**用户取消关注微信
	 * @param USER_ID
	 * @return
	 * @throws Exception
	 */
	
	public Boolean updateUnsubscribe(String openId,String developid) throws Exception;
	
	
	public  MyWxMpConfigStorage getTokenByGroupId(Long groupId);
	
	
	/**
	 * 校验缓存
	 * @param key 传会员ID
	 * @return
	 */
	public  Boolean getToken(String memberId,String token);
	
	
	
	/**
	 * 登录获取缓存  并返回前端
	 * @param key 传会员ID
	 * @return
	 */
	public  Token getToken(String memberId);
	
	/**
	 * 刷新缓存
	 * @param key
	 */
	public  void refresh(String memberId);
	
	/**
	 * 删除缓存
	 * @param key
	 */
	public  void invalidate(String memberId);
//	
//	public void editWxBase(WxMpUser wxMpUser)throws Exception;
//	
//	/**保存用户
//	 * @param pd
//	 * @throws Exception
//	 */
//	public void saveWxBase(WxMpUser wxMpUser)throws Exception;

   
}
